cd "C:\Users\dlk265\Box\Atkinson Projects\Misinformation\Harvard Misinformation\Data\Final Replication files\"
use "kk_misinformation_data.dta", clear

* Labels *
*label define categories7 1 "Real: Origins/Response" 2 "Misinformation: Origins/Response" 3 "Placebo: Origins/Response" 4 "Real: Treatments" 5 "Misinformation: Treatments" 6 "Placebo: Treatments" 7 "Misinformation: Chinese Sources", replace
*label values category7 categories7

* Aggregate true recall of misinformation test *
gen misinformation = 0
replace misinformation = 1 if category7 == 2
replace misinformation = 1 if category7 == 5
ttest recall if misinformation==1|placebo==1, by(placebo)

* Figure 1: Estimating True Recall  *
use "kk_misinformation_data.dta", clear

ciplot recall, by(category6) horizontal graphregion(color(white)) yti("") xti("") xlabel(0 "0%" .1 "10%" .2 "20%" .3 "30%" .4 "40%" .5 "50%" .6 "60%") note("") msymbol(circle) mcolor(black) xti(" " "Reported recall")

gen count = _n
replace count = . if count > 6
label define types 1 "Origins/Response" 2 "Treatments" 
label values count types
gen diff = .
gen lower = .
gen upper = .
gen mean = .
gen meanu = .
gen meanl = .
tab category6, gen(cats)

reg recall  cats1-cats6, nocons
replace mean = r(table)[1,1] if count == 6
replace mean = r(table)[1,2] if count == 5
replace mean = r(table)[1,3] if count == 4
replace mean = r(table)[1,4] if count == 3
replace mean = r(table)[1,5] if count == 2
replace mean = r(table)[1,6] if count == 1

replace meanu = r(table)[6,1] if count == 6
replace meanu = r(table)[6,2] if count == 5
replace meanu = r(table)[6,3] if count == 4
replace meanu = r(table)[6,4] if count == 3
replace meanu = r(table)[6,5] if count == 2
replace meanu = r(table)[6,6] if count == 1

replace meanl = r(table)[5,1] if count == 6
replace meanl = r(table)[5,2] if count == 5
replace meanl = r(table)[5,3] if count == 4
replace meanl = r(table)[5,4] if count == 3
replace meanl = r(table)[5,5] if count == 2
replace meanl = r(table)[5,6] if count == 1

twoway (bar mean count if count <7, horizontal bcolor(gs5) barwidth(.8)) (rcap meanu meanl count if count <7, horizontal color(black)),  ylabel(6 "Real: Origins/Response" 5 "Misinformation: Origins/Response" 4 "Placebo: Origins/Response" 3 "Real: Treatments" 2 "Misinformation: Treatments" 1 "Placebo:Treatments" , angle(0)) ytitle("") legend(off) graphregion(color(white)) ti("") xti(" " "Reported Recalled") xlabel(0 .1 "10%" .2 "20%" .3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%") scale(.8) saving(new_fig1_top.gph, replace)

reg recall misinformation_headline if category6 == 2 | category6 == 3
replace diff = r(table)[1,1] if count == 1
replace lower = r(table)[5,1] if count == 1
replace upper = r(table)[6,1] if count == 1

reg recall misinformation_headline if category6 == 5 | category6 == 6
replace diff = r(table)[1,1] if count == 2
replace lower = r(table)[5,1] if count == 2
replace upper = r(table)[6,1] if count == 2

eclplot diff lower upper count, horizontal graphregion(color(white)) ylabel(1 2) xlabel(0 "0%" .02 "2%" .04 "4%" .06 "6%" .08 "8%" .1 "10%" .12 "12%" .14 "14%" .16 "16%") xti(" " " 'True' Recall (Misinformation - Placebo)") yti("") yscale(range(.5 2.5)) xline(0) estopts1(msymbol(color(black))) ciopts(blcolor(black)) saving(new_fig1_bottom.gph, replace)

graph combine "new_fig1_top" "new_fig1_bottom", rows(2) cols(1) xsize(8.5) ysize(11) graphregion(color(white))


* Figure 2: Accuracy Beliefs  *
use "kk_misinformation_data.dta", clear

graph hbar accuracy_true accuracy_false accuracy_unsure, over(category7) stack percent graphregion(color(white)) legend(order(1 "True" 2 "False" 3 "Unsure") rows(1)) ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%" 80 "80%" 100 "100%") yti("") blabel(bar, position(center) format(%3.0f)) bar(1, fcolor(gs6) lcolor(black)) bar(2, fcolor(gs11) lcolor(black)) bar(3, fcolor(gs15) lcolor(black)) scale(.8)

* Figure 3: Partisanship, Trump Approval, and Accuracy Perceptions of Misinformation *
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==2, base(3) cluster(ResponseId)
margins, dydx(gop5 dem5 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Origins/Response", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2))  saving("origins_trump.gph", replace)

mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==5, base(3) cluster(ResponseId)
margins, dydx(gop5 dem5 approve_trump ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Treatments", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square))  yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2)) saving("treatments_trump.gph", replace)

mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==7, base(3) cluster(ResponseId)
margins, dydx(gop5 dem5 approve_trump ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Chinese Sources", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square))  yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2)) saving("china_trump.gph", replace)

grc1leg2 "origins_trump.gph" "treatments_trump.gph" "china_trump.gph", graphregion(color(white)) rows(2) cols(1) xsize(8.5) ysize(11) legendfrom(origins_trump.gph) 

* Figure 4: Trump Approval and Accuracy Perceptions of Real Headlines *
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==1|category7==4, base(3) cluster(ResponseId)
test [True]approve_trump=[False]approve_trump
test [True]dem5=[False]dem5
test [True]gop5=[False]gop5
margins, dydx(gop5 dem5 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Real: Origins/Response and Treatments", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22))  saving("real_trump.gph", replace)

* Figure 5: Trump approval, News Consumption, and Accuracy Perceptions of Misinformation *
gen news = social_news+tv_news+papers_news

mlogit accuracy_belief gop5 dem5 i.approve_trump##c.news education income age female black latino if category7==2 | category7==5 | category7==7, base(3) cluster(ResponseId)
margins, at(news=(3(1)12) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("Misinformation: Orgins/Response, Treatments, and Chinese Sources", size(medium)) graphregion(color(white)) saving(news_origins.gph, replace) plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4 .5) xti("Self-reported news consumption") xlabel(3 "Low" 4 " " 5 " " 6 " " 7 " "  8 " " 9 " " 10 " " 11 " " 12 "High", angle(90) notick) yscale(range(0 .52))

* SI Figure 1: Recalled and Believed *
use "kk_misinformation_data.dta", clear

ciplot recall_and_believed, by(category6) horizontal graphregion(color(white)) yti("") xti("") xlabel(0 "0%" .1 "10%" .2 "20%" .3 "30%" .4 "40%" .5 "50%" .6 "60%") note("") msymbol(circle) mcolor(black) xti(" " "Reported recall")

gen count = _n
replace count = . if count > 6
label define types 1 "Origins/Response" 2 "Treatments" 
label values count types
gen diff = .
gen lower = .
gen upper = .
gen mean = .
gen meanu = .
gen meanl = .
tab category6, gen(cats)

reg recall_and_believed  cats1-cats6, nocons
replace mean = r(table)[1,1] if count == 6
replace mean = r(table)[1,2] if count == 5
replace mean = r(table)[1,3] if count == 4
replace mean = r(table)[1,4] if count == 3
replace mean = r(table)[1,5] if count == 2
replace mean = r(table)[1,6] if count == 1

replace meanu = r(table)[6,1] if count == 6
replace meanu = r(table)[6,2] if count == 5
replace meanu = r(table)[6,3] if count == 4
replace meanu = r(table)[6,4] if count == 3
replace meanu = r(table)[6,5] if count == 2
replace meanu = r(table)[6,6] if count == 1

replace meanl = r(table)[5,1] if count == 6
replace meanl = r(table)[5,2] if count == 5
replace meanl = r(table)[5,3] if count == 4
replace meanl = r(table)[5,4] if count == 3
replace meanl = r(table)[5,5] if count == 2
replace meanl = r(table)[5,6] if count == 1

twoway (bar mean count if count <7, horizontal bcolor(gs5) barwidth(.8)) (rcap meanu meanl count if count <7, horizontal color(black)),  ylabel(6 "Real: Origins/Response" 5 "Misinformation: Origins/Response" 4 "Placebo: Origins/Response" 3 "Real: Treatments" 2 "Misinformation: Treatments" 1 "Placebo:Treatments" , angle(0)) ytitle("") legend(off) graphregion(color(white)) ti("") xti(" " "Recalled and Believed") xlabel(0 .1 "10%" .2 "20%" .3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%") scale(.8) saving(new_fig1_top.gph, replace)

reg recall_and_believed misinformation if category6 == 2 | category6 == 3
replace diff = r(table)[1,1] if count == 1
replace lower = r(table)[5,1] if count == 1
replace upper = r(table)[6,1] if count == 1

reg recall_and_believed misinformation if category6 == 5 | category6 == 6
replace diff = r(table)[1,1] if count == 2
replace lower = r(table)[5,1] if count == 2
replace upper = r(table)[6,1] if count == 2

eclplot diff lower upper count, horizontal graphregion(color(white)) ylabel(1 2) xlabel(-.02 "-2%" 0 "0%" .02 "2%" .04 "4%" .06 "6%" .08 "8%" .1 "10%") xti(" " " Recalled and Believed (Misinformation - Placebo)") yti("") yscale(range(.5 2.5)) xline(0) estopts1(msymbol(color(black))) ciopts(blcolor(black)) saving(new_fig1_bottom.gph, replace)

graph combine "new_fig1_top" "new_fig1_bottom", rows(2) cols(1) xsize(8.5) ysize(11) graphregion(color(white))


* SI Figure 2: PARTISAN GAPS WITH NO TRUMP APPROVAL *
mlogit accuracy_belief gop5 dem5   education income age female black latino if category7==2, base(3) cluster(ResponseId)
test [True]dem5=[True]gop5
test [False]dem5=[False]gop5
margins, dydx(gop5 dem5 ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Origins/Response", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat") ///
plot1opts(msymbol(square)) yscale(range(.8 2.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22))  saving("origins_notrump.gph", replace)

mlogit accuracy_belief gop5 dem5   education income age female black latino if category7==5, base(3) cluster(ResponseId)
test [True]dem5=[True]gop5
test [False]dem5=[False]gop5
margins, dydx(gop5 dem5  ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Treatments", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat") ///
plot1opts(msymbol(square))  yscale(range(.8 2.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22)) saving("treatments_notrump.gph", replace)

mlogit accuracy_belief gop5 dem5   education income age female black latino if category7==7, base(3) cluster(ResponseId)
test [True]dem5=[True]gop5
test [False]dem5=[False]gop5
margins, dydx(gop5 dem5  ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Chinese Sources", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat") ///
plot1opts(msymbol(square))  yscale(range(.8 2.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22)) saving("china_notrump.gph", replace)

grc1leg2 "origins_notrump.gph" "treatments_notrump.gph" "china_notrump.gph", graphregion(color(white)) rows(2) cols(1) xsize(8.5) ysize(11) legendfrom(treatments_notrump.gph) 

* Figuring out tests *
mlogit accuracy_belief gop5 dem5   education income age female black latino if category7==7, base(3) cluster(ResponseId) coeflegend
test [True]dem5=[True]gop5
test [False]dem5=[False]gop5
test _b[True:gop5]=_b[True:dem5]
test _b[False:gop5]=_b[False:dem5]

* SI Figure 3: Replicating Figure 3 with Partisan Leaners *

mlogit accuracy_belief gop3 dem3 approve_trump  education income age female black latino if category7==2, base(3) cluster(ResponseId)
margins, dydx(gop3 dem3 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Origins/Response", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2))  saving("lean_origins_trump.gph", replace)

mlogit accuracy_belief gop3 dem3 approve_trump  education income age female black latino if category7==5, base(3) cluster(ResponseId)
margins, dydx(gop3 dem3 approve_trump ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Treatments", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square))  yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2)) saving("lean_treatments_trump.gph", replace)

mlogit accuracy_belief gop3 dem3 approve_trump  education income age female black latino if category7==7, base(3) cluster(ResponseId)
margins, dydx(gop3 dem3 approve_trump ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Chinese Sources", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square))  yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2)) saving("lean_china_trump.gph", replace)

grc1leg2 "lean_origins_trump.gph" "lean_treatments_trump.gph" "lean_china_trump.gph", graphregion(color(white)) rows(2) cols(1) xsize(8.5) ysize(11) legendfrom(lean_origins_trump.gph) 

* SI Figure 4: Trump Approval and Real Headlines by Category  *
* Null results for two categories separately mentioned in footnote *
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==1, base(3) cluster(ResponseId)
test [True]approve_trump=[False]approve_trump
margins, dydx(gop5 dem5 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Real: Origins/Response", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22))  saving("real_origins_trump.gph", replace)

mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==4, base(3) cluster(ResponseId)
test [True]approve_trump=[False]approve_trump
margins, dydx(gop5 dem5 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Real: Treatments", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22))  saving("real_treatments_trump.gph", replace)

grc1leg2 "real_origins_trump.gph" "real_treatments_trump.gph", graphregion(color(white)) rows(2) cols(1) xsize(8.5) ysize(11) legendfrom(real_origins_trump.gph) 

* SI Figure 5: Placebo Headlines and Trump approval *
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==3, base(3) cluster(ResponseId)
test [True]approve_trump=[False]approve_trump
margins, dydx(gop5 dem5 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Placebo: Origins/Response", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22))  saving("plac_origins_trump.gph", replace)

mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==6, base(3) cluster(ResponseId)
test [True]approve_trump=[False]approve_trump
margins, dydx(gop5 dem5 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Placebo: Treatments", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.2 -.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.2 .22))  saving("plac_treatments_trump.gph", replace)

grc1leg2 "plac_origins_trump.gph" "plac_treatments_trump.gph", graphregion(color(white)) rows(2) cols(1) xsize(8.5) ysize(11) legendfrom(plac_origins_trump.gph) 

* SI Figure 6: Trump Approval, News Consumption, and Accuracy Perceptions by Category *

mlogit accuracy_belief gop5 dem5 i.approve_trump##c.news education income age female black latino if category7==2, base(3) cluster(ResponseId)
margins, at(news=(3(1)12) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("Misinformation: Origins", size(medium)) graphregion(color(white)) saving(news_origins.gph, replace) plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4 .5 .6) xti("Self-reported news consumption") xlabel(3 "Low" 4 5 6 7 8 9 10 11 12 "High", angle(90)) yscale(range(0 .42)) yti("Pred. probability" " ")

mlogit accuracy_belief gop5 dem5 i.approve_trump##c.news education income age female black latino if category7==5, base(3) cluster(ResponseId)
margins, at(news=(3(1)12) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("Misinformation: Treatments", size(medium)) graphregion(color(white)) saving(news_treatments.gph, replace) plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4 .5 .6) xti("Self-reported news consumption") xlabel(3 "Low" 4 5 6 7 8 9 10 11 12 "High", angle(90)) yscale(range(0 .42)) yti("Pred. probability" " ")

mlogit accuracy_belief gop5 dem5 i.approve_trump##c.news education income age female black latino if category7==7, base(3) cluster(ResponseId)
margins, at(news=(3(1)12) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("Misinformation: Chinese Sources", size(medium)) graphregion(color(white)) saving(news_china.gph, replace) plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4 .5 .6) xti("Self-reported news consumption") xlabel(3 "Low" 4 5 6 7 8 9 10 11 12 "High", angle(90)) yscale(range(0 .42)) yti("Pred. probability" " ")
grc1leg2 "news_origins.gph" "news_treatments.gph" "news_china.gph", graphregion(color(white)) rows(3) cols(1) xsize(8.5) ysize(11) legendfrom(news_china.gph) 

* SI Figure 7: Trump Approval, News Consumption by Source, and Accuracy Perceptions *
* TV News *
mlogit accuracy_belief gop5 dem5 i.approve_trump##c.tv_news education income age female black latino if category7==2 | category7==5 | category7==7, base(3) cluster(ResponseId)
margins, at(tv_news=(1(1)4) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("TV News", size(medium)) graphregion(color(white))  plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4) xti("Use of TV for News") xlabel(1 "Low" 2 " " 3 " " 4 "High", angle(90) notick) yscale(range(0 .42)) saving(tvnews.gph, replace) yti("Pred. probability" " ")

mlogit accuracy_belief gop5 dem5 i.approve_trump##c.papers_news education income age female black latino if category7==2 | category7==5 | category7==7, base(3) cluster(ResponseId)
margins, at(papers_news=(1(1)4) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("Newspapers", size(medium)) graphregion(color(white))  plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4) xti("Use of Newspapers for News") xlabel(1 "Low" 2 " " 3 " " 4 "High", angle(90) notick) yscale(range(0 .42)) saving(papersnews.gph, replace) yti("Pred. probability" " ")

mlogit accuracy_belief gop5 dem5 i.approve_trump##c.social_news education income age female black latino if category7==2 | category7==5 | category7==7, base(3) cluster(ResponseId)
margins, at(social_news=(1(1)4) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("Social Media", size(medium)) graphregion(color(white))  plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4) xti("Use of Social Media for News") xlabel(1 "Low" 2 " " 3 " " 4 "High", angle(90) notick) yscale(range(0 .42)) saving(socialnews.gph, replace) yti("Pred. probability" " ")

grc1leg2 "tvnews.gph" "papersnews.gph" "socialnews.gph", graphregion(color(white)) rows(3) cols(1) xsize(8.5) ysize(11) legendfrom(tvnews.gph) 

* SI Figure 8: Replicating Figure 1 excluding "speeders" *
use "kk_misinformation_data.dta", clear
drop if duration <= 141
gen count = _n
replace count = . if count > 6
label define types 1 "Origins/Response" 2 "Treatments" 
label values count types
gen diff = .
gen lower = .
gen upper = .
gen mean = .
gen meanu = .
gen meanl = .
tab category6, gen(cats)

reg recall  cats1-cats6, nocons
replace mean = r(table)[1,1] if count == 6
replace mean = r(table)[1,2] if count == 5
replace mean = r(table)[1,3] if count == 4
replace mean = r(table)[1,4] if count == 3
replace mean = r(table)[1,5] if count == 2
replace mean = r(table)[1,6] if count == 1

replace meanu = r(table)[6,1] if count == 6
replace meanu = r(table)[6,2] if count == 5
replace meanu = r(table)[6,3] if count == 4
replace meanu = r(table)[6,4] if count == 3
replace meanu = r(table)[6,5] if count == 2
replace meanu = r(table)[6,6] if count == 1

replace meanl = r(table)[5,1] if count == 6
replace meanl = r(table)[5,2] if count == 5
replace meanl = r(table)[5,3] if count == 4
replace meanl = r(table)[5,4] if count == 3
replace meanl = r(table)[5,5] if count == 2
replace meanl = r(table)[5,6] if count == 1

twoway (bar mean count if count <7, horizontal bcolor(gs5) barwidth(.8)) (rcap meanu meanl count if count <7, horizontal color(black)),  ylabel(6 "Real: Origins/Response" 5 "Misinformation: Origins/Response" 4 "Placebo: Origins/Response" 3 "Real: Treatments" 2 "Misinformation: Treatments" 1 "Placebo:Treatments" , angle(0)) ytitle("") legend(off) graphregion(color(white)) ti("") xti(" " "Reported Recalled") xlabel(0 .1 "10%" .2 "20%" .3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%") scale(.8) saving(new_fig1_top.gph, replace)

reg recall misinformation_headline if category6 == 2 | category6 == 3
replace diff = r(table)[1,1] if count == 1
replace lower = r(table)[5,1] if count == 1
replace upper = r(table)[6,1] if count == 1

reg recall misinformation_headline if category6 == 5 | category6 == 6
replace diff = r(table)[1,1] if count == 2
replace lower = r(table)[5,1] if count == 2
replace upper = r(table)[6,1] if count == 2

eclplot diff lower upper count, horizontal graphregion(color(white)) ylabel(1 2) xlabel(0 "0%" .02 "2%" .04 "4%" .06 "6%" .08 "8%" .1 "10%" .12 "12%" .14 "14%" .16 "16%") xti(" " " 'True' Recall (Misinformation - Placebo)") yti("") yscale(range(.5 2.5)) xline(0) estopts1(msymbol(color(black))) ciopts(blcolor(black)) saving(new_fig1_bottom.gph, replace)

graph combine "new_fig1_top" "new_fig1_bottom", rows(2) cols(1) xsize(8.5) ysize(11) graphregion(color(white))

* SI Figure 9: Trump approval, Accuracy Perceptions of Misinformation, Omitting "Speeders" *
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==2, base(3) cluster(ResponseId)
margins, dydx(gop5 dem5 approve_trump) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Origins/Response", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square)) yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2))  saving("origins_trump.gph", replace)

mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==5, base(3) cluster(ResponseId)
margins, dydx(gop5 dem5 approve_trump ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Treatments", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square))  yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2)) saving("treatments_trump.gph", replace)

mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==7, base(3) cluster(ResponseId)
margins, dydx(gop5 dem5 approve_trump ) predict(pr outcome(1)) predict(pr outcome(2))
mplotoffset, recast(scatter) xline(0) graphregion(color(white)) ti("Misinformation: Chinese Sources", size(medsmall)) horizontal xti(" " "Marginal effect on probability of each outcome") yti("") ///
legend(order(3 "True" 4 "False")rows(1)) ysc(reverse) ylabel(1 "Republican" 2 "Democrat" 3 "Approve of Trump") ///
plot1opts(msymbol(square))  yscale(range(.8 3.2)) offset(.1) xlabel(-.15 -.1 -.05 0 .05 .1 .15 .2) xscale(range(-.17 .2)) saving("china_trump.gph", replace)

grc1leg2 "origins_trump.gph" "treatments_trump.gph" "china_trump.gph", graphregion(color(white)) rows(2) cols(1) xsize(8.5) ysize(11) legendfrom(origins_trump.gph) 

* SI Figure 10: Trump Approval, News Consumption, and Accuracy Perceptions of Misinformation, Omitting "Speeders" *
gen news = social_news+tv_news+papers_news

mlogit accuracy_belief gop5 dem5 i.approve_trump##c.news education income age female black latino if category7==2 | category7==5 | category7==7, base(3) cluster(ResponseId)
margins, at(news=(3(1)12) approve_trump=(0(1)1) education=4 income=3 female=1 black=0 latino=0) predict(outcome(1))  post 
mplotoffset, legend(order(3 "Does Not Approve of Trump" 4 "Approve of Trump")) yti("Predicted probability" " ") ti("Misinformation: Orgins/Response, Treatments, and Chinese Sources", size(medium)) graphregion(color(white)) saving(news_origins.gph, replace) plot1opts(msymbol(square)) ylabel(.1 .2 .3 .4 .5) xti("Self-reported news consumption") xlabel(3 "Low" 4 " " 5 " " 6 " " 7 " "  8 " " 9 " " 10 " " 11 " " 12 "High", angle(90) notick) yscale(range(0 .52))

* SI Table 5: Models for Figure 3 *
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==2, base(3) cluster(ResponseId)
outreg2 using sitable4, word dec(2) 2aster label replace
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==5, base(3) cluster(ResponseId)
outreg2 using sitable4, word dec(2) 2aster label append
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==7, base(3) cluster(ResponseId)
outreg2 using sitable4, word dec(2) 2aster label append

* SI Table 6: Models for Figure 4 *
mlogit accuracy_belief gop5 dem5 approve_trump  education income age female black latino if category7==1|category7==4, base(3) cluster(ResponseId)
outreg2 using sitable5, word dec(2) 2aster label replace

* SI Table 7: Models for Figure 5 *
mlogit accuracy_belief gop5 dem5 i.approve_trump##c.news education income age female black latino if category7==2 | category7==5 | category7==7, base(3) cluster(ResponseId)
outreg2 using sitable6, word dec(2) 2aster label replace

* SI Table 4: Demos *
* delete multiple observations for each respondent *
duplicates drop ResponseId, force
sum gop5 dem5 gop3 dem3 approve_trump
gen news = social_news+tv_news+papers_news
sum tv_news papers_news social_news news

sum education
gen college = 0
replace college = 1 if education>=5
sum college
sum income
sum age female black latino
sum age, detail
